package com.yuan.serviceribbon.controller;/**
 * @ClassName HelloController
 * @Description TODO
 * @Author yuan
 * @Date 2020/8/4 11:34
 * @Version 1.0
 */

import com.yuan.serviceribbon.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName HelloController
 * @Description:
 * @Author yuan
 * @Date 2020/8/4 
 * @Version V1.0
 **/
@RestController
public class HelloController {

    @Autowired
    private HelloService helloService;

    @RequestMapping(value = "hello")
    public String hi(){
        return  ",this is ribbon server<br/>" + helloService.hello("");
    }


    /**
     * @description:    熔断接口
     * @auther:         yuan
     * @date:           2020/8/4 15:04
     * @param:
     * @return:
     */
    @GetMapping(value = "hystrixHi")
    public String hystrixHi(@RequestParam String name){
        return helloService.hystrixHi(name);
    }

    @GetMapping(value = "ribbon")
    public String ribbon(){

        return "this is ribbon+hystrixHi<br/>"+helloService.hystrixHi("");
    }

}
